//
//  File.swift
//
//
//  Created by didi on 2022/9/13.
//

import SwiftHtml
import Vapor

public struct BreadcrumbTemplate: TemplateRepresentable {
    public let context: BreadcrumbContext

    public init(_ context: BreadcrumbContext) {
        self.context = context
    }

    @TagBuilder
    public func render(_ req: Request) -> Tag {
        Div {
            Nav {
                context.links.map { LinkTemplate($0).render(req) }
            }
        }
        .id("breadcrumb")
        .class("noselect")
    }
}
